<?php
	include(ROOTPATH .'class'. DS .'task.class.php');
	$page 			= getPage('page');
	$queryCode		= getQuery('query');
	
	$id				= (int)getPage('id');
	
	$orderByType	= getQuery('orderByType');
	if( $orderByType != 'DESC' && $orderByType != 'ASC')
		$orderByType = 'DESC' ;
	
	
	$query			= $encrypt -> recode($queryCode);
	$query 			= explode(INVITE_SPLIT_STRING , $query );	//412|-_-|111@qqq.com|-_-|2010-06-30|-_-|20 	
	$task_id		= (int)$query[0];
	$invite			= $query[1];
	$timeEnd		= $query[2];
	$selectionArea	= $query[3];
	
	$isAdmin		= false ;
	
	if($invite == '我是管理员' && $timeEnd == '我没有时间限制' ){
		include(ROOTPATH .'include'. DS .'checkUserLogin.php');
		$isAdmin = true ;
	}else{
	
		$isHasTask 		= true ;
		$isCanAssess	= true ;
		
		$sql 			= 'SELECT * FROM `'. DB_PRE .'task` WHERE `id` = '. $task_id .' limit 0,1' ;
		$lists			= $dbs -> select($sql);
		if(count($lists) == 0 )
			$isHasTask 		= false ;
			//exit('<li class="error">这个任务不存在<li>');
		$show = $lists[0];
		
		$sql 			= 'SELECT * FROM `'. DB_PRE .'task_invite` WHERE `task_id` = '. $task_id .' and `invite` = "'. $invite .'" and `timeEnd` = "'. $timeEnd .'" ';
		$lists			= $dbs -> select($sql);
		if(count($lists) == 0 )
			$isCanAssess	= false ;
			//exit('<li class="error">您没有权限对此任务评分. 您没有被邀请.<li>');
	}
		
	
	$task			= new task();
	$taskAssess		= new taskAssess();
	
	
?>